//
//  ActivityWorkoutsRecordCurrentTotalItem.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/10/31.
//

import Foundation
import MYModule

class ActivityWorkoutsRecordCurrentTotalItem: StackView {
    
    override func makeUI() {
        super.makeUI()
        
        let subStack = StackView()
        subStack.axis = .horizontal
        subStack.alignment = .center
        subStack.contentMode = .center
        subStack.spacing = 3

        subStack.addArrangedSubview(self.iconImageView)
        self.iconImageView.snp.makeConstraints { make in
            make.width.height.equalTo(14)
        }
        
        let labelStack = StackView()
        labelStack.axis = .horizontal
        labelStack.alignment = .bottom
        labelStack.contentMode = .center
        labelStack.spacing = 3
        labelStack.addArrangedSubview(self.numLabel)
        labelStack.addArrangedSubview(self.unitLabel)
        
        subStack.addArrangedSubview(labelStack)
        
        self.spacing = 2
        self.axis = .vertical
        self.alignment = .center
        self.contentMode = .center

        self.addArrangedSubview(subStack)
        self.addArrangedSubview(self.titleLabel)
        
        self.numLabel.text = "9.9"
        self.unitLabel.text = "kcal/kcal"
        self.titleLabel.text = "Total duiration duration"
    }
    
    //MARK: - lazy load -
    lazy var iconImageView: ImageView = {
        let imageView = ImageView()
        imageView.contentMode = .scaleAspectFit
        return imageView
    }()

    lazy var numLabel: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 22)
        label.textColor = UIColor.assist_222222
        return label
    }()
    
    lazy var unitLabel: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 10)
        label.textColor = UIColor.assist_222222
        return label
    }()
    
    lazy var titleLabel: Label = {
        let label = Label()
        label.font = Fonts.boldSystemFont(ofSize: 10)
        label.textColor = UIColor.assist_222222
        label.textAlignment = .center
        return label
    }()
}
